/**Backpack.java
 * 
 * This class is the backpack for the player.
 * This stores all the equipment the player has.
 * 
 * @author Christopher Carithers
 * Last Updated: 5/13/2014
 *
 */


import java.util.List;
import java.util.Vector;

public class Backpack
{
   private List<Weapon> m_Weapons = new Vector<Weapon>();
   public void getWeaponsInBackpack()
   {   
	   String weaponName;
	   String weaponDescription;
	   boolean weaponEquiped;
	   
	   for(int i = 0; i < m_Weapons.size(); i++)
       {
		  weaponName = m_Weapons.get(i).getItemName();
		  weaponEquiped = m_Weapons.get(i).getEquipedToPlayer();
		  weaponDescription = m_Weapons.get(i).getItemDescription();
		  
		  System.out.print(i+1 + ". ");
          System.out.print(weaponName + " " + weaponDescription + "  ");
          if(weaponEquiped == true)
          {
        	 System.out.println("Equiped");
          }
       }
   }
   
   public void setWeapons(Weapon weapon)
   {
	   m_Weapons.add(weapon);
   }
   
   public int getNumberOfWeapons()
   {
	  return m_Weapons.size();
   }
   
   public void equipedWeaponInBackpack(int weaponNumber)
   {
	   String weaponName;
	   boolean weaponEquiped;
	   int i = 1;
	   
	   while(i != weaponNumber)
       {
	      i++;
       }
	   m_Weapons.get(i-1).setEquipedToPlayer(true);
   }
}
